package com.mia.props.common;

import com.mia.props.TabProps;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;

public class ItemCratingClay extends Item {
   public static IIcon[] clayIcons = new IIcon[3];
   public static String[] clayNames = new String[]{"red", "blue", "green"};

   public ItemCratingClay() {
      this.setMaxDamage(0);
      this.setHasSubtypes(true);
      this.setCreativeTab(TabProps.Main.get());
   }

   public void registerIcons(IIconRegister par1IconRegister) {
      clayIcons[0] = par1IconRegister.registerIcon("props:reddecoclay");
      clayIcons[1] = par1IconRegister.registerIcon("props:bluedecoclay");
      clayIcons[2] = par1IconRegister.registerIcon("props:greendecoclay");
   }

   public IIcon getIconFromDamage(int dmg) {
      return clayIcons[dmg];
   }

   public String getUnlocalizedName(ItemStack par1ItemStack) {
      return "items.craftingclay." + clayNames[par1ItemStack.getItemDamage()];
   }

   @SideOnly(Side.CLIENT)
   public void getSubItems(Item itemID, CreativeTabs tabs, List list) {
      list.add(new ItemStack(itemID, 1, 0));
      list.add(new ItemStack(itemID, 1, 1));
      list.add(new ItemStack(itemID, 1, 2));
   }
}
